package com.lwj.liwanjia.presenter;

import com.lwj.liwanjia.bean.LeftBean;
import com.lwj.liwanjia.bean.LeftBean1;
import com.lwj.liwanjia.impl.LeftView;
import com.lwj.liwanjia.impl.LeftView1;
import com.lwj.liwanjia.model.LeftModel;
import com.lwj.liwanjia.model.LeftModel1;

import rx.Subscriber;

/**
 * Created by Administrator on 2017/11/1.
 */

public class LeftPresenter1 {
    private LeftModel1 leftModel1;
    private LeftView1 leftView1;

    public LeftPresenter1(LeftView1 leftView1) {
        this.leftView1 = leftView1;
        leftModel1 = new LeftModel1();
    }

    public void getLeftType1(String token, int id) {
        if (leftView1 != null) {
            leftModel1.getLeftType1(token, id, new Subscriber<LeftBean1>() {
                @Override
                public void onCompleted() {

                }

                @Override
                public void onError(Throwable e) {
                    leftView1.showError((Exception) e);
                }

                @Override
                public void onNext(LeftBean1 leftBean1) {
                    leftView1.getLeftType1(leftBean1);
                }
            });
        }
    }
}
